<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page trimDirectiveWhitespaces="true" %>
<%@include file="/admin/include/includeAdminTaglibs.jsp" %>
<!Doctype html>
<t:base type="jquery,easyui1.5,dateformat"></t:base>
<t:datagrid name="infoGrid" actionUrl="/admin/service/list" fit="true" fitColumns="true" idField="id" queryMode="group" pageSize="20" title="被照护人列表">
    <t:dgCol title="系统编号" field="serviceId" hidden="false"></t:dgCol>
    <t:dgCol title="姓名" sortable="false" field="fullName"></t:dgCol>
    <t:dgCol title="性别" sortable="false" field="sex" replace="男_1,女_2"></t:dgCol>
    <t:dgToolBar title="添加" icon="icon-add" funname="top.contentIFrameLoadUrl" url="/admin/service/form" width="28%"></t:dgToolBar>
    <t:dgToolBar title="修改" icon="icon-edit" funname="editService" url="/admin/service/form" width="28%" idFiledName="serviceId"></t:dgToolBar>
    <t:dgToolBar title="评估记录" icon="icon-add" funname="loadDataContentIFrameLoadUrl" url="/admin/evaluation/recordList" width="28%" idFiledName="serviceId"></t:dgToolBar>
</t:datagrid>
<script>
    function editService(title, url, gridId, width, height, idFiledName) {
        var rowsData = $("#" + gridId).datagrid('getSelected');
        if (rowsData == null) {
            top.tip('请选择要修改的被照护人');
            return;
        }
        url += '?serviceId=' + rowsData[idFiledName]
        window.location.href=url
    }
    function loadDataContentIFrameLoadUrl(title, url, gridId, width, height, idFiledName) {
        var rowsData = $("#" + gridId).datagrid('getSelected');
        if (rowsData == null) {
            top.tip('请选择要查看的被照护人');
            return;
        }
        url += '?serviceId=' + rowsData[idFiledName]
        top.document.getElementById("contentIFrame").src=url
    }
</script>